﻿Public Class fZadaniWhispedList

    Private Sub fZadaniWhispedList_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Me.Dispose()

    End Sub

    Private Sub fZadaniWhispedList_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        Dim g As DataGridView = Me.DGV_WhispList
        For i As Long = 0 To arrRec.GetUpperBound(0)
            Dim dgr As New DataGridViewRow
            ReDim arrCust(2)
            For j As Long = 0 To arrRec.GetUpperBound(1)
                arrCust(j) = arrRec(i, j)
            Next j
            dgr.CreateCells(g, arrCust)
            g.Rows.Add(dgr)
        Next i
        g.Update()
        g.Show()

        'ttipRClckHint.Show("Klikněte na řádek, který chcete vybrat.", Me.DGV_WhispList, 3000)
        AddHandler DGV_WhispList.CellClick, AddressOf DGV_WhispList_CellClick
    End Sub

    Private Sub DGV_WhispList_CellClick(ByVal sender As DataGridView, ByVal e As System.EventArgs) Handles DGV_WhispList.CellClick
        Dim c As DataGridViewCell = sender.CurrentCell
        Dim i As Long = c.RowIndex
        Dim r As DataGridViewRow = DGV_WhispList.Rows.Item(i)

        My.Forms.fZadaniPrijmy.tboxJmeno.Text = r.Cells(0).Value.ToString
        My.Forms.fZadaniPrijmy.tboxPrijmeni.Text = r.Cells(1).Value.ToString
        My.Forms.fZadaniPrijmy.tboxAdresa.Text = r.Cells(2).Value.ToString

        Me.Close()

    End Sub
End Class